package Q2;

import java.util.Scanner;

public class Main {

    public static int n; //人数
    public static int a; //双人船价钱
    public static int b; //三人船价钱
    public static long ret = Integer.MAX_VALUE;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int t = scanner.nextInt();
        while (t > 0) {
            t--;
            n = scanner.nextInt();
            a = scanner.nextInt();
            b = scanner.nextInt();

            dfs(n, 0);
            System.out.println(ret);
            ret = Integer.MAX_VALUE;
        }
    }

    /**
     *
     * @param count 剩余的人数
     * @param price 总价
     */
    public static void dfs(int count, long price) {
        if (count <= 0) {
            ret = Math.min(ret, price);
            return;
        }

        //选双人船
        dfs(count - 2, price + a);

        //选三人船
        dfs(count - 3, price + b);
    }
}
